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0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 ;
0 0 0 0 0 1 0 0 0 0 1 0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 -1 1 0 0 0 0 0 -1 0 ;
-1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 -1 0 0 0 0 1 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 ;
];

p = 5;

g = 9.800;

x_fixed = [0.726
0.148
0.106
0.785
0.707
];

y_fixed = [0.339
0.837
0.407
0.120
0.972
];

m = [0.265
0.633
0.187
0.456
0.689
0.814
0.204
0.264
0.380
0.614
0.515
0.941
0.758
0.930
0.650
0.638
0.151
0.010
0.745
0.238
];

k_tot = 200;

# Mass x-coordinates for uniform stiffness allocation.
x_unif = [0.726
0.148
0.106
0.785
0.707
0.530
0.436
0.456
0.459
0.507
0.533
0.411
0.510
0.515
0.418
0.508
0.529
0.464
0.570
0.485
];

# Mass y-coordinates for uniform stiffness allocation.
y_unif = [0.339
0.837
0.407
0.120
0.972
-0.949
-0.351
-0.180
-0.465
-0.400
-0.165
-0.607
-0.815
-0.594
-0.714
-0.374
-0.501
-0.223
-0.628
-0.551
];


